import java.util.Scanner;

public class Training09 {
    public static void main(String[] args) {
        System.out.println("请输入班级人数:");
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        double[] score = new double[num];
        for (int i = 0; i < score.length;i++) {
            System.out.println("请输入学号是"+(i+1) +"学生的成绩");
            score[i] = sc.nextDouble();
        }
        int w80 = 0;
        int w70 = 0;
        int w60 = 0;
        int y60 = 0;
        double sum = 0;
        for (int i = 0; i<score.length;i++){
            sum = sum +score[i];
            if(score[i] >=80) {
                w80++;
            }else if (score[i] >=70) {
                w70++;
            }else if (score[i] >=60) {
                w60++;
            }else if (score[i] <60) {
                y60++;
            }else {
                System.out.println("第" +(i+1) +"成绩格式错误");
            }
        }
        double avg = sum / score.length;
        System.out.println("全班平均成绩为："+ avg);
        System.out.println("成绩大于80分："+w80);
        System.out.println("成绩大于70分："+w70);
        System.out.println("成绩大于60分："+w60);
        System.out.println("成绩不及格："+y60);
    }
}

